<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<title>Symbol layers highways</title>

<link rel="stylesheet" href="https://js.arcgis.com/4.0/esri/css/main.css">
<script src="https://js.arcgis.com/4.0/"></script>

<style>
html,
body,
#viewDiv
{
  padding: 0;
  margin: 0;
  height: 100%;
  width: 100%;
}
</style>

<script>
require([
    "esri/Map",
    "esri/views/SceneView",
    "esri/layers/FeatureLayer",
    "esri/renderers/UniqueValueRenderer",
    "esri/symbols/LineSymbol3DLayer",
    "esri/symbols/LineSymbol3D",
    "dojo/domReady!"
  ],
  function(
    Map, SceneView, FeatureLayer, UniqueValueRenderer, LineSymbol3DLayer, LineSymbol3D
  ) {

    var initCam = {
      position: {
        x: -12986481,
        y: 3879642,
        z: 85789,
        spatialReference: { wkid: 3857 }
      },
      heading: 319,
      tilt: 65
    };

    var interstateSymbol = new LineSymbol3D({
      symbolLayers: [
        new LineSymbol3DLayer({
          material: { color: [255,255,0] },
          size: 6
        }),
        new LineSymbol3DLayer({
          material: { color: "black" },
          size: 2
        })
      ]
    });

    var stateSymbol = new LineSymbol3D({
      symbolLayers: [
        new LineSymbol3DLayer({
          material: { color: "white" },
          size: 4
        }),
        new LineSymbol3DLayer({
          material: { color: "gray" },
          size: 1
        })
      ]
    });

    var countySymbol = new LineSymbol3D({
      symbolLayers: [
        new LineSymbol3DLayer({
          material: { color: "orange" },
          size: 3
        })
      ]
    });

    var renderer = new UniqueValueRenderer({
      field: "CLASS",
      uniqueValueInfos: [{
        value: "I",
        symbol: interstateSymbol
      }, {
        value: "S",
        symbol: stateSymbol
      }, {
        value: "U",
        symbol: countySymbol
      }]
    });

    var highwayLyr = new FeatureLayer({
      url: "http://services.arcgis.com/P3ePLMYs2RVChkJx/ArcGIS/rest/services/USA_Freeway_System/FeatureServer",
      layerId: 2,
      renderer: renderer,
      popupTemplate: {
        title: "{CLASS}-{NUMBER}",
        content: "Distance: {DIST_MILES} miles"
      },
      outFields: ["*"],
      maxScale: 0,
      minScale: 0
    });

    /*****************************************************************
     * Add the layer to a map
     *****************************************************************/
    var map = new Map({
      basemap: "dark-gray",
      layers: [ highwayLyr ],
      ground: "world-elevation"
    });

    var view = new SceneView({
      container: "viewDiv",
      map: map,
      camera: initCam
    });

  });
</script>
</head>

<body>
  <div id="viewDiv"></div>
</body>

</html>